package com.lyshop.guiyingshanding.view;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.lyshop.guiyingshanding.R;

public class CommonRuleDialog extends MyDialog implements View.OnClickListener {

    private View rootView;
    private TextView tv_content;
    private TextView tv_sure;


    public CommonRuleDialog(Context context, String rule) {
        this(context, false, Gravity.CENTER, rule);
    }

    public CommonRuleDialog(Context context, boolean isCancelAble, int gravity, String rule) {
        super(context, isCancelAble, gravity);
        rootView = LayoutInflater.from(context).inflate(R.layout.dialog_common_rule, null);
        setContentView(rootView);

        tv_content = rootView.findViewById(R.id.tv_content);
        tv_sure = rootView.findViewById(R.id.tv_sure);
        tv_sure.setOnClickListener(this);
        tv_content.setText(rule);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_sure:
                dismiss();
                break;
        }
    }


}
